# -*- coding:utf-8 -*-
"""
__author__='Wang Bo'
email:joker_wb@163.com
二分查找
"""

def two_divide_find(a,l,r,tag):
    while(l<=r):
        mid=int((r+l)/2)
        print(mid)
        if(mid==tag):
            return True
        else:
            if(a[mid]<tag):
                l=mid+1
            else:
                r=mid-1

    return False


a=list(range(20))
print(a)

print(two_divide_find(a,0,len(a)-1,6))